package com.heima.jopo.utilconn;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class GetConn {
    private static String url = "jdbc:mysql://127.0.0.1:3306/t_user?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
    private static String user = "root";
    private static String password = "123456";


    public static Connection getConn() {

        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            return DriverManager.getConnection(url, user, password);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }

        return null;
    }
}